home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13774 < prev    next >
Encoding:
Text File  |  1996-08-05  |  992 b   |  35 lines

  1. Path: news.channel1.com!channel1!dspse.bedford
  2. Distribution: world
  3. Newsgroups: comp.lang.c++
  4. Subject: Passing numbers
  5. From: dspse.bedford@channel1.com (Dspse Bedford)
  6. Message-ID: <40.88695.1613@channel1.com>
  7. Date: Wed, 27 Mar 1996 06:28:00 -0640
  8. Organization: Channel 1(R) 617-864-0100 Info
  9.  
  10. Lets say I have the following class and functions defined:
  11.  
  12. class A{
  13. ...
  14.   void func(long lvar);
  15.   void func(int  ivar);
  16. ....
  17. };
  18.   I know that the compiler can not decide if 
  19.   A a;
  20.   a.func(30);
  21.   
  22.   should match up with the int version of func or the long version of 
  23.   func.  However, is there anyway I can tell the compiler which one to 
  24.   use as a default definition such that the above would always be mapped
  25.   to my default definition.  In other words, if an arguement, such as
  26.   a number, causes an ambiguity use the default definition.  Does anyone
  27.   know how or why not?
  28.  
  29.   thank you
  30.   Anastasios Maurudis
  31.   anastasios@dspse.com
  32.  
  33. ---
  34.  * WR 1.32 # 331 * `:-| "Fascinating, Captain!" - Spock
  35.